package com.linux.huhx.springDefined;

import com.linux.huhx.BaseTest.InitBean;
import examples.ClientService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by huhx on 2017-05-17.
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("huhx.xml");
//        InitBean initBean = (InitBean) context.getBean("initTest");
//        initBean.sayHello();
//        SimpleDateFormat info = (SimpleDateFormat) context.getBean("dateFormat");
//        System.out.println(info.format(new Date()));

        ClientService clientService = context.getBean("clientService", ClientService.class);
        clientService.sayHello();
    }
}
